package com.zilu.digitaltwin.dto;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author :caijianbao
 * @date : 2023/2/11 17:55
 */
@Data
public class BoundAggObjectDTO {

    /**
     * 村舍、镇街、网格等code
     */
    private String code;

    /**
     * 村舍、镇街、网格等name
     */
    private String name;

    private String wkt;

    /**
     * 属性值集合 valueCode -> PropertyDTO
     */
    private Map<String, PropertyDTO> propertyMap;

    /**
     * 实体集合
     */
    private Map<String, EntityInfoDTO> entityInfoMap;


    @Data
    public static class PropertyDTO {

        private String propertyCode;

        private String valueCode;

        private String valueName;

        private Long cnt;
    }

    public Map<String, PropertyDTO> getPropertyMap() {
        if (propertyMap == null) {
            propertyMap = new HashMap<>();
        }
        return propertyMap;
    }

    public Map<String, EntityInfoDTO> getEntityInfoMap() {
        if (entityInfoMap == null) {
            entityInfoMap = new HashMap<>();
        }
        return entityInfoMap;
    }
}
